/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package controlador;

import bean.Disciplina;
import dao.DisciplinaDao;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author Jennerson
 */
public class ControladorDisciplina {

    private DisciplinaDao disciplinaDAO;

    public ControladorDisciplina() {
        this.disciplinaDAO = new DisciplinaDao();
    }

    public void SalvarDisciplina(Disciplina d) {
        disciplinaDAO.Salvar(d);
    }

    public void ExcluirDisciplina(int id) {
        disciplinaDAO.Excluir(id);
    }

    public Disciplina ConsultarDisciplina(int id) {
        Disciplina d = disciplinaDAO.Consultar(id);
		return d;
    }

    public void AlterarDisciplina(Disciplina d) {
        disciplinaDAO.Alterar(d);
    }

    public List<Disciplina> ListarDisciplinas() {
        List<Disciplina> ld = disciplinaDAO.Listar();
        return ld;
    }
    
    public int getIdDisciplina(){
        
        int i = disciplinaDAO.getId();
        return i;
    }
}
